https://glot.io/snippets/ghld8y0i8c/raw/main.lua